body {
  background: var(--sakai-background-color-2);
}

p,
h1,
form,
button {
  border: 0;
  margin: 0;
  padding: 0;
}

.spacer {
  clear: both;
  height: 25px;
}

/* ----------- wrapper ------------ */
.wrapper {
  border: 2px solid var(--sakai-active-color-1);
  padding: 10px 40px 20px 40px;
  background: var(--sakai-background-color-1);
  margin: 2em auto;
  max-width: 35%;
  min-width: fit-content;
  border-radius: 8px;
}

.header {
  padding: 5px 0 15px;
  border-bottom: 1px solid var(--sakai-border-color);
  margin-bottom: 10px;
}

/* ----------- stylized ----------- */

h1 {
  font-weight: bold;
  margin-bottom: 8px;
}

h3 {
  text-align: center;
}

label {
  display: block;
  font-weight: bold;
  margin-top: 0.5em;
  width: fit-content;
  text-align: left;
}

span.reqStar {
  /* needed to override tool.css */
  float: none;
  margin-left: 2px;
  border: 0 none;
  font-weight: bold;
}

.username {
  color: var(--infoBanner-color);
  font-weight: bold;
}

input {
  margin-bottom: 5px;
}

div.instruction {
  display: block;
  margin: 0 auto;
  text-align: center;
  width: fit-content;
  font-size: 13px;
}

#strengthInfo {
    display: none; /* Hidden by default, shown by JavaScript */
    color: var(--sakai-text-color-1);
    background-color: var(--sakai-background-color-1);
    border: 1px solid var(--sakai-border-color);
    border-radius: 4px;
    box-shadow: var(--elevation-2dp);
    padding: 1em;
    position: absolute;
    width: 300px; /* Fixed width instead of percentage */
    z-index: 1000; /* Ensure it appears above other content */

    /* Position to the right of the input field */
    left: calc(100% + 1em); /* Start 1em to the right of parent */
    top: 0; /* Align with top of input field */

    /* Prevent wrapping issues */
    white-space: normal;
    word-wrap: break-word;
}

/* Arrow pointing left (toward the input field) */
#strengthInfo::before {
    border-bottom: 15px solid transparent;
    border-right: 15px solid var(--sakai-border-color);
    border-top: 15px solid transparent;
    position: absolute;
    content: "";
    left: -15px; /* Position arrow outside the box */
    top: 1em; /* Position near the top */
    width: 0;
    height: 0;
}

/* Inner arrow for border effect */
#strengthInfo::after {
    border-bottom: 14px solid transparent;
    border-right: 14px solid var(--sakai-background-color-1);
    border-top: 14px solid transparent;
    position: absolute;
    content: "";
    left: -14px;
    top: 1em;
    width: 0;
    height: 0;
}

/* Make the parent container relative for absolute positioning to work */
.col-xs-5 {
    position: relative;
}

/* Responsive: Show below input on smaller screens */
@media (max-width: 768px) {
    #strengthInfo {
        position: static;
        width: 100%;
        margin-top: 0.5em;
        left: auto;
        top: auto;
    }

    #strengthInfo::before,
    #strengthInfo::after {
        display: none; /* Hide arrow on mobile */
    }
}

#matchMsg,
#strongMsg,
#noMatchMsg,
#weakMsg,
#failMsg,
#moderateMsg {
  display: block;
  font-size: 0.8em;
}

#strengthBar {
  background-color: var(--sakai-background-color-2);
  height: 5px;
  text-align: left;
  margin-bottom: 3px;
}

#strengthBarMeter {
  display: inline-block;
  width: 0%;
  height: 100%;
  background-color: var(--errorBanner-color);
}

.sak-banner-error,
.sak-banner-success {
  margin: 16px 0 0;
}
